@extends('admin.app')

@section('breadcrumb')
    <div class="bg-light lter b-b wrapper-md">
        <ol class="breadcrumb bg-light lter m-n no-padder">
            <li><a href="{{ admin_action('HomeController@index') }}">主页</a></li>
            <li>网站管理</li>
            <li class="active">运营管理</li>
        </ol>
    </div>
@endsection

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            运营统计
        </div>
        <div class="row wrapper">
            <div class="col-sm-8">
                <form class="form-horizontal" method="get"
                      action="{{ admin_action('Web\CooController@cooStatistic') }}">
                    <div class="row">
                        <div class="col-sm-5">
                            <div class="form-group">
                                <label class="control-label col-sm-4">开始时间:</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datetimepicker" name="start_at"
                                           value="{{ $query['start_at'] }}" placeholder="请选择开始时间" readonly="readonly">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-5">
                            <div class="form-group">
                                <label class="control-label col-sm-4">结束时间:</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control datetimepicker" name="end_at"
                                           value="{{$query['end_at']}}" placeholder="请选择结束时间" readonly="readonly">
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-1 text-left">
                            <span class="input-group-btn">
                              <button class="btn btn-sm btn-default" type="submit">查询</button>
                            </span>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th>项目数</th>
                    <th>期间交易量</th>
                    <th>期间注册人数</th>
                    <th>期间有效投资人数</th>
                    <th>为投资人赚取的收益</th>
                    <th>平均预期年化收益率</th>
                    <th>平均项目期限</th>
                    <th>到期量</th>
                    <th>待收收益</th>
                    <th>时点存量</th>
                </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>{{$list['project_num']}}</td>
                        <td>{{number_format($list['record_trades'],2)}}元</td>
                        <td>{{$list['register_user']}}人</td>
                        <td>{{$list['records_num']}}人</td>
                        <td>{{number_format($list['records_money'],2)}}元</td>
                        <td>{{$list['ms_rate']}}%</td>
                        <td>{{$list['ms_term']}}天</td>
                        <td>{{number_format($list['expire_money'],2)}}</td>
                        <td>{{number_format($list['record_profit'],2)}}</td>
                        <td>{{number_format($list['record_money'],2)}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
@endsection